package com.jinxin.platform.cdsmsmgr.pojo.enums;

/**
 * @Author 那个男人
 * @Date 2023/1/6 15:47
 * @Version 1.0
 */
public enum OuterTemplateType {
    TYPE_0(0,"验证码短信"),
    TYPE_1(1,"通知短信"),
    TYPE_2(2,"推广短信"),
    TYPE_3(3,"国际/港澳台消息"),
    TYPE_7(7,"数字短信");

    private int type;
    private String desc;

    OuterTemplateType(int code, String desc) {
        this.type = code;
        this.desc = desc;
    }
    // 普通方法
    public static String getDesc(int code) {
        for (OuterTemplateType c : OuterTemplateType.values()) {
            if (c.getType() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public static Integer getCode(String desc) {
        for (OuterTemplateType c : OuterTemplateType.values()) {
            if (c.getDesc().equals(desc)) {
                return c.type;
            }
        }
        return null;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
